/*
 * Copyright 2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mx.ymate.security;

import com.mx.ymate.dev.result.MxResult;
import com.mx.ymate.security.handler.ILoginHandler;
import com.mx.ymate.security.handler.IUserHandler;
import net.ymate.platform.core.beans.annotation.Ignored;
import net.ymate.platform.core.support.IInitialization;

/**
 * ISaTokenConfig generated By ModuleMojo on 2022/07/03 12:39
 *
 * @author YMP (https://www.ymate.net/)
 */
@Ignored
public interface ISecurityConfig extends IInitialization<ISecurity> {

    String ENABLED = "enabled";

    String CLIENT = "client";

    String LOGIN_HANDLER_CLASS = "loginHandlerClass";

    String USER_HANDLER_CLASS = "userHandlerClass";

    String ERROR_COUNT = "errorCount";

    String OPEN_LOG = "openLog";

    String EXCLUDE_PATH_PATTERNS = "excludePathPatterns";

    /**
     * 模块是否已启用, 默认值: true
     *
     * @return 返回false表示禁用
     */
    boolean isEnabled();

    /**
     * 客户端名称
     *
     * @return
     */
    String client();

    /**
     * loginHandler实现类
     *
     * @return
     */
   ILoginHandler loginHandlerClass();

    /**
     * userHandler实现类
     */
   IUserHandler userHandlerClass();

    /**
     * 验证错误N次后锁定账户  默认不锁定  -1不锁定
     */
    int errorCount();

    /**
     * 是否开启日志记录 默认false
     */
    boolean openLog();

    /**
     * 登录拦截排除的路径用|分割
     */
    String excludePathPatterns();

    boolean error(MxResult mxResult);

}